var payConfirmPwdCtrl;

$(function(){
	$("#payConfirmSubmitId").removeAttr("disabled");
	
	if($("#needPaypwd").val()=="y"){
		payConfirmPwdCtrl=new PwdControl("payPassword","payConfirmPwdDiv",222,28);
	}

});

var payConfirmSubmit = function(){
    if($("#needPaypwd").val()=="y"){
        $.ajax({
            type:"GET",
            url: ctx+"/getPayPwdUUID.shtml",
            data:{ts:new Date().getTime(),count:1,safe:1},
            async:false,
            dataType:"json",
            success:function(r){
                if(r&&r.code1){
                    payConfirmPwdCtrl.encrypt(r.code1,1);
                }else{
                    alert("获取支付密码随机码失败");
                }
            }
        });

        if($("#payPassword").val()==""){
            alert("支付密码获取失败");
            return false;
        }
    }
	$("#payConfirmForm").submit();
	$("#payConfirmSubmitTr").hide();

    $("#payConfirmSubmitId")[0].disabled = true;
    $("#payConfirmSubmitId").html("处理中...");
};
